<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>短信管理</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../include/commonFile.jsp" %>
    <style type="text/css">
        .search-container .layui-form-select, .search-container input[type=text] {
            width: 212px!important;
        }
    </style>
</head><body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">

            <form class="layui-form" action="${ctx}/notify/message/listAll.do" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo"/>
                <input type="hidden" name="targetId" id="targetId" value="${instanceWithMember.targetId}"/>
                <input type="hidden" name="templateId" id="templateId" value="${instanceWithMember.templateId}"/>
                <div class="f-search-bar">
                    <div class="search-container">
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">发送者</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="memberName" autocomplete="off" class="layui-input"
                                           value="${instanceWithMember.memberName}" placeholder="发送者">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">手机号</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="receiver" autocomplete="off" class="layui-input"
                                           value="${instanceWithMember.receiver}" placeholder="手机号">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">是否成功</label>
                                <div class="layui-input-inline">
                                    <select name="isSuccess">
                                        <option value="">全部</option>
                                        <option value="1" ${instanceWithMember.isSuccess == 1? 'selected="selected"' : ''}>成功</option>
                                        <option value="0" ${instanceWithMember.isSuccess == 0 ? 'selected="selected"' : ''}>失败</option>
                                    </select>
                                </div>
                            </li>
                        </ul>
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">交互号</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="msgId" autocomplete="off" class="layui-input"
                                           value="${instanceWithMember.msgId}" placeholder="交互号">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">内容</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="title" autocomplete="off" class="layui-input"
                                           value="${instanceWithMember.title}" placeholder="内容">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">状态值</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="status" autocomplete="off" class="layui-input"
                                           value="${instanceWithMember.status}" placeholder="状态值" style="width: 195px">
                                </div>
                            </li>
                        </ul>
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">方&emsp;式</label>
                                <div class="layui-input-inline">
                                    <select name="way">
                                        <option value="">全部</option>
                                        <option value="ORGANIZATION" ${instanceWithMember.way == 'ORGANIZATION'? 'selected="selected"' : ''}>机构</option>
                                        <option value="SYSTEM" ${instanceWithMember.way == 'SYSTEM' ? 'selected="selected"' : ''}>平台</option>
                                    </select>
                                </div>
                            </li>
                        </ul>
                        <ul class="search-form-content">
                            <li class="form-item"><label class="search-form-lable">发送时间</label>
                                <div class="check-btn-inner">
                                    <a id="all" href="javascript:void(0);"
                                       onclick="setTimeType($(this),0,'#myForm')" ${empty instanceWithMember.timeType || instanceWithMember.timeType == 0 ? 'class="active"' : ''}>全部</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),1,'#myForm')" ${instanceWithMember.timeType == 1 ? 'class="active"' : ''}>今天</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),2,'#myForm')" ${instanceWithMember.timeType == 2 ? 'class="active"' : ''}>本周内</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),3,'#myForm')" ${instanceWithMember.timeType == 3 ? 'class="active"' : ''}>本月内</a>
                                    <input type="hidden" name="timeType" value="${instanceWithMember.timeType}"/>
                                </div>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createStart"
                                               value="${instanceWithMember.createStart}" placeholder="开始日"

                                        >
                                    </div>
                                    -
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createEnd"
                                               value="${instanceWithMember.createEnd}" placeholder="截止日"

                                        >
                                    </div>
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger"
                                       href="javascript:submitFunction('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal"
                                       href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
            <div class="my-act-list-content">
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col width="150px">
                            <col width="130px">
                            <col>
                            <col width="160px">
                            <col width="90px">
                            <col width="90px">
                            <col width="200px">
                            <col width="90px">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>发送者</th>
                            <th>手机号</th>
                            <th>内容</th>
                            <th>时间</th>
                            <th>发送结果</th>
                            <th>状态码</th>
                            <th>交互号</th>
                            <th>状态值</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="message" items="${list}">
                            <tr>
                                <td class="ellipsis-1">
                                        ${message.memberName}
                                </td>
                                <td class="">
                                    <div class="ellipsis-1" title="${message.receiver}">${message.receiver}</div>
                                </td>
                                <td>
                                        ${message.title}
                                </td>
                                <td>
                                    <fmt:formatDate value="${message.createDate}" pattern="yyyy-MM-dd HH:mm"/>
                                </td>
                                <td>
                                    <c:if test="${message.isSuccess ==0}"> 失败</c:if>
                                    <c:if test="${message.isSuccess ==1}"> 成功</c:if>
                                </td>
                                <td>
                                        ${message.result}
                                </td>
                                <td>
                                        ${message.msgId}
                                </td>
                                <td>
                                        ${message.status}
                                        <c:if test="${message.isNewFlag == 3}"><span class="red">余额不足</span></c:if>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="page_content" class="page-container"></div>
        </div>
        <!--底部-->
        <%@include file="../include/footer.jsp" %>
    </section>
</div>


<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    $(function () {
//加载分页
        loadPageNew({elem: 'page_content', totalCount: '${page.totalCount}', limit: '${page.limit}', page: '${page.page}'});
        layui.use(['laydate'], function () {
            var laydate = layui.laydate;
            // 查询发布日期
            var start = {
                elem: 'input[name=createStart]'
            };

            var end = {
                elem: 'input[name=createEnd]'
            };
            laydate.render(start);
            laydate.render(end);
        });
    })

</script>
<script type="text/javascript">
    txz.initHeader({
        nav:[{
            name: '短信管理',
            curr: true
        }],
        info:'<span class="f12">共<b id="totalCount">${page.totalCount}</b>条记录</span>'
    });
</script>
</body>
</html>